/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.core.entity;

import com.google.common.collect.Lists;
import com.intelligent.ispc.common.persistence.BaseEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.List;

/**
 * Created by Peter.Li on 2015/10/9.
 */
@Entity
@Table(name = "t_organization")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Organization extends BaseEntity {
    private String name;

    @OneToMany(mappedBy = "organization")
    private List<User> users = Lists.newArrayList();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }
}
